package com.zhehekeji.opsys.api.entity;

import java.util.Date;

// Generated 2015-4-2 15:51:20 by Hibernate Tools 3.4.0.CR1
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TWinningRule generated by hbm2java
 */
@Entity(name="com.zhehekeji.opsys.api.entity.TWinningRule")
@Table(name="t_winning_rule")
public class TWinningRule implements java.io.Serializable {

	/** 
	* @Fields serialVersionUID : TODO
	*/ 
	private static final long serialVersionUID = 3728908111083466780L;
	private Long id;
	private TActivity tactivity;
	private TPrize tprize;
	private Integer drawSeq;
	private Date winningDate;
	private Date createTime = new Date();
	private Integer status;
	private Long cpCode;
	public TWinningRule() {
	}

	public TWinningRule(Integer drawSeq,
			Date winningDate, Date createTime, Integer status) {
		this.drawSeq = drawSeq;
		this.winningDate = winningDate;
		this.createTime = createTime;
		this.status = status;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="ACTIVITY_ID")
	public TActivity getTactivity() {
		return tactivity;
	}

	public void setTactivity(TActivity tactivity) {
		this.tactivity = tactivity;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="PRIZE_ID")
	public TPrize getTprize() {
		return tprize;
	}

	public void setTprize(TPrize tprize) {
		this.tprize = tprize;
	}
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID",length=20,nullable=false,unique=true)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="DRAW_SEQ",length=11,nullable=true)
	public Integer getDrawSeq() {
		return this.drawSeq;
	}

	public void setDrawSeq(Integer drawSeq) {
		this.drawSeq = drawSeq;
	}
	@Temporal(TemporalType.DATE)
	@Column(name="WINNING_DATE",nullable=true)
	public Date getWinningDate() {
		return this.winningDate;
	}

	public void setWinningDate(Date winningDate) {
		this.winningDate = winningDate;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME",nullable=true)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name="STATUS",length=2,nullable=true)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name="CP_CODE",length=20,nullable=true)
	public Long getCpCode() {
		return cpCode;
	}

	public void setCpCode(Long cpCode) {
		this.cpCode = cpCode;
	}

}
